package com.bawei.module_classify.mvp

import android.util.Log
import com.bawei.library_base.mvp.p.BasePresenter
import io.reactivex.Observer
import io.reactivex.disposables.Disposable

/**
 * @date : 2021/12/14
 * @author : zhiyu
 * @content :
 */
class GoodPresenter (m:GoodContract.GoodModel,v:GoodContract.GoodView):
    BasePresenter< GoodContract.GoodModel,GoodContract.GoodView>(m,v) {

        fun getGoods(id:Int){
            mModel.getGoods(object :Observer<Goods>{
                override fun onSubscribe(d: Disposable) {

                }

                override fun onNext(t: Goods) {
                    mView.initAdapter(t.data)
                    Log.i("1111111111TAG", "onNext: "+t)
                }

                override fun onError(e: Throwable) {

                }

                override fun onComplete() {

                }

            },id)
        }


    fun getvGoods(id:Int){
        mModel.getGoods(object :Observer<Goods>{
            override fun onSubscribe(d: Disposable) {

            }

            override fun onNext(t: Goods) {
                mView.initsAdapter(t.data)

                Log.i("1111111111TAG", "onNext: "+t)
            }

            override fun onError(e: Throwable) {

            }

            override fun onComplete() {

            }

        },id)
    }


}